﻿<catel:DataWindow x:Class="Caitlyn.Views.RuleView"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				  xmlns:catel="http://catel.codeplex.com">
    
    <!-- Resources -->
    <catel:DataWindow.Resources>
    </catel:DataWindow.Resources>

    <!-- Content -->
    <catel:StackGrid>
		<catel:StackGrid.RowDefinitions>
			<RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</catel:StackGrid.RowDefinitions>

        <catel:StackGrid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="400" />
            <ColumnDefinition Width="Auto" />
        </catel:StackGrid.ColumnDefinitions>

        <Label Content="Project item" />
        <TextBox Text="{Binding Name, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" />
        <Button Command="{Binding SelectProjectItem}" Content="..." />

        <Label Content="Rule type" />
        <ComboBox catel:StackGrid.ColumnSpan="2" ItemsSource="{Binding RuleTypes}" SelectedItem="{Binding Type}" />

        <GroupBox catel:StackGrid.ColumnSpan="3" Header="This rule applies to the following projects">
            <ItemsControl ItemsSource="{Binding ProjectTypes}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Content="{Binding Name}" IsChecked="{Binding IsSelected}" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </GroupBox>
    </catel:StackGrid>
</catel:DataWindow>
